package test.singleton;

public class SingletonLazy {

    private static SingletonLazy singleton;

    private SingletonLazy() {
    }

    public static SingletonLazy getInstance() throws InterruptedException {
        if (singleton == null) {
            // 模拟操作中的停顿
            Thread.sleep(10L);
            singleton = new SingletonLazy();
        }
        return singleton;
    }
}
